
/**
 * Created by xiongshilin on 2017/4/14.
 */
(function(){
    ADF.editpart.BootstrapColumnEditPart = function(){
        ADF.editpart.BootstrapColumnEditPart.superclass.constructor.call(this);
    }
    COM.util.defineClass(ADF.editpart.BootstrapColumnEditPart, ADF.editpart.CompositeEditpart,{
        _createFigure: function(){
            var figure = new ADF.figure.BootstrapColumnFigure();
            var columnControl = this.getWidgetFactory().createControl(this.getModel());
            figure.setWidget(columnControl);
            return figure;
        },

        createEditPolicies: function(){
            ADF.editpart.BootstrapColumnEditPart.superclass.createEditPolicies.call(this);
            //this.installEditPolicy(COM.gef.EditPolicy.CONTAINER_ROLE, new COM.demo.DiagramContainerEditPolicy());
            this.installEditPolicy(COM.gef.EditPolicy.LAYOUT_ROLE, new ADF.policy.ColumnLayoutPolicy());
        },

        getModelChildren: function(){
            var column = this.getModel();
            return column.getChildren();
        },
        refreshVisuals: function() {
            var widgetBounds = this.getFigure().getWidget().getBounds();
            this.getFigure().setPreferredSize(new COM.draw2d.Dimension(widgetBounds.width, widgetBounds.height));
        }
    });
})();